/* 封装的axios
* @ 劳兆城
* @ 2017-08-02 */

import axios from 'axios'
import { httpUrl, sysID } from 'api/config'
import storage from 'good-storage';

// 专用于数据一张图-内河涌的axios
export function ajaxPost (url, data, option) {
  url = `${httpUrl.slice(0, -1)}${url}?system_id=${sysID}`
  return axios.post(url, data, option)
    .then((res) => {
      return Promise.resolve(res.data)
    })
}

// axios Get方式
export function ajaxGet (url, data) {
  return axios.get(
    url,
    {
      params: data,
    }
  ).then((res) => {
    console.log('结果', res)
    return Promise.resolve(res.data)
  })
}
